package com.chaopei.znpk.service.impl;

import com.chaopei.znpk.entity.Course;
import com.chaopei.znpk.mapper.CourseMapper;
import com.chaopei.znpk.service.CourseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 28458
* @description 针对表【course】的数据库操作Service实现
* @createDate 2022-05-18 10:49:47
*/
@Service
public class CourseServiceImpl implements CourseService {
    @Resource
    private CourseMapper courseMapper;

    @Override
    public int add(Course course) {
        if (course!=null){
            return courseMapper.insertOne(course);
        }
        return -1;

    }

    @Override
    public List<Course> list() {
        return courseMapper.selectAll();
    }
}




